//
//  KRNodataView.m
//  KEREN
//
//  Created by MW on 2023/5/5.
//

#import "KRNodataView.h"

@implementation KRNodataView

-(instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if(self){
        self.frame = CGRectMake(0, 0, DEVICE_WIDTH, 300);
        [self addUI];
    }
    return self;
}

- (void)addUI{
    UIImageView *imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"no_data_icon"]];
    [self addSubview:imageView];
    [imageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.offset(50);
        make.width.height.offset(204);
        make.centerX.equalTo(self);
    }];
    UILabel *nodataLbl = [UILabel setLblText:@"暂无数据" font:Font(16) withColor:Color_333333 inSubView:self];
    [nodataLbl mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self);
        make.top.equalTo(imageView.mas_bottom).offset(-6);
    }];
}
@end
